Skip to content

Response: add From<StatusCode>#650

Merged
yoshuawuyts merged 1 commit intohttp-rs:masterfrom
Fishrock123:response-from-statuscode
Jul 18, 2020
Merged

Response: add From<StatusCode>#650
yoshuawuyts merged 1 commit intohttp-rs:masterfrom
Fishrock123:response-from-statuscode

Conversation

@Fishrock123
Copy link
Member

Description

Allows you to do e.g. Ok(NotFound) from an Endpoint / Middleware.

Motivation and Context

Ergonomics

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Allows you to do e.g. `Ok(NotFound)` from an Endpoint / Middleware.
Copy link
Member

@jbr jbr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tempting to also add a u16 variant of this (for Ok(404) but that’s probably too far

@yoshuawuyts yoshuawuyts merged commit 00670b3 into http-rs:master Jul 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants